#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cstring>

using namespace std;

int main( int argc, char* argv[] )
{
 if( argc < 4 )
 { 
  cout << "Usage 1: TumorMovie <start_time> <increment> <end_time>" 
       << endl << endl;
  return -1; 
 }
 
 double start_time = strtod( argv[1] , NULL );
 double dt   = strtod( argv[2] , NULL );
 double end_time = strtod( argv[3] , NULL );
 
 int frame = 0;
 while( start_time - frame*dt > 1e-8 )
 { frame++; } 
 double time = frame*dt;
 
 while( end_time - time > -1e-8 )
 {
  cout << start_time << " " << time << " " << end_time << endl;

  char Command [2049];
  sprintf( Command, "./CompositeFrame %f frame%08i.bmp", time, frame );
  system( Command );
 
  frame++;
  time = dt*frame;
 } 

 return 0;
}
